/**
 * @Description:
 * @author tao.xie
 * @date $
 */

import React, { Component } from 'react'
import { StyleSheet, View, Text, TouchableOpacity} from 'react-native'
import { withNavigation } from 'react-navigation'
import { px2dp } from 'rn-xiaobu-utils'
import StoreModule from './StoreModule.js'

class OrderModule extends React.PureComponent {

  constructor (props) {
    super(props)
  }


  render () {
    return (
      <TouchableOpacity >
        <View style={styles.container}>
          <Text>订单号:{this.props.order.orderID}</Text>
          {
            this.props.order.storeOrder.map(store =>
              <StoreModule store={store}/>
            )
          }
          <Text style={styles.payFee}>总价: ¥{this.props.order.payFee}</Text>
        </View>
      </TouchableOpacity>
    )
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    padding: px2dp(30),
    borderBottomColor: '#dedede',
    borderBottomWidth: px2dp(1)
  },
  payFee: {
    textAlign: 'right'
  }
})

export default withNavigation(OrderModule)